﻿using System;
using System.ComponentModel;

namespace Framework.Common.Attributes
{
    /// <summary>
    /// 描述枚举
    /// </summary>
    [AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Class, AllowMultiple = false)]
    public sealed class OrderedDescAttribute : DescriptionAttribute
    {
        /// <summary>
        /// 顺序（绑定时候用）
        /// </summary>
        public Object Value { get; private set; }

        /// <summary>
        /// 构造器
        /// </summary>
        /// <param name="description"></param>
        public OrderedDescAttribute(string description)
            : base(description)
        { }

        /// <summary>
        /// 构造器
        /// </summary>
        /// <param name="description"></param>
        /// <param name="order"></param>
        public OrderedDescAttribute(string description, Object v)
            : base(description)
        {
            Value = v;
        }
    }
}
